import axios from "@/utils/axios";
// 登录接口
export function GoLogin(data) {
  return axios({
    url: "/api/login",
    method: "post",
    data,
  });
}
// 首页tab栏
export function navigation() {
  return axios.get("/api/category");
}
// 导航栏接口
export function newNav() {
  return axios.get("/api/groom/list/3?page=1&limit=10");
}
export function newNavs(id) {
  return axios.get(
    "/api/products?sid=0&keyword=&priceOrder=&salesOrder=&news=0&page=1&limit=20&cid=" +
      id +
      ""
  );
}
export function recommend() {
  return axios.get("/api/product/hot?page=1&limit=10");
}
// 详情页;
export function detail(id) {
  return axios.get("/api/product/detail/" + id + "");
}
export function getprice() {
  return axios.get("/api/coupons?page=1&limit=10");
}
// 加入购物车
export function GoShop(id, num, newA, uid) {
  return axios.post("/api/cart/add", {
    productId: id,
    cartNum: num,
    new: newA,
    uniqueId: uid,
  });
}
// 购物车数据
export function getShop() {
  return axios.get("/api/cart/list?page=1&limit=20&status=1");
}
// 购物车数量
export function getShopLength() {
  return axios.get("/api/cart/count?numType=0");
}
// 购物车删除
export function getShopdel(id) {
  return axios.post("/api/cart/del", {
    ids: id,
  });
}
// 我的
export function getMy() {
  return axios.get("/api/user");
}
// 我的页面
export function getMyMain() {
  return axios.get("/api/menu/user");
}
// 地址管理
export function getMysite() {
  return axios.get("/api/address/list?page=1&limit=20");
}
// 立即结算
export function goClose(cartid, newNum, newLenght, uid) {
  return axios.post("/api/cart/add", {
    productId: cartid,
    cartNum: newNum,
    new: newLenght,
    uniqueId: uid,
  });
}
// 结算
export function geCloses(cartid, newLenght) {
  return axios.post("/api/order/confirm", {
    cartId: cartid,
    new: newLenght,
  });
}
// 沙河支付
export function getCloses(data) {
  return axios({
    url: "/api/alipayWap",
    method: "get",
    data,
  });
}
